package com.ihealthway.all.groupbuy.vo;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

import java.util.Date;

/**
  * Bean class for goods design
 * @author 凡梦星尘(elkan1788@gmail.com)
 */
@Table("gb_goods")
public class Goods {

    @Id
    @Column("goods_id")
    private Integer goodsId;
    @Column("c_id")
    private Integer companyId;
    @One(target = Company.class, field = "companyId", key = "companyId")
    private Company company;
    @Column("goods_name")
    private String goodsName;
    @Column("price")
    private Integer price;
    @Column("goods_type")
    private Integer type;
    @Column("detail_info")
    private String detailInfo;
    @Column("end_time")
    private Date endTime;
    @Column("limit_num")
    private Integer limitNum;
    @Column("sales")
    private Integer sales;
    /*@Column("share_des")
    private String shareDes;*/
    @Column("views")
    private Integer views;
    @Column("remarks")
    private String remarks;
    @Column("create_time")
    private Date createTime;
    @Column("update_time")
    private Date updateTime;
    @Column("data_status")
    private String dataStatus;

    private String companyName;
    private String imgUrl;

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public Integer getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDetailInfo() {
        return detailInfo;
    }

    public void setDetailInfo(String detailInfo) {
        this.detailInfo = detailInfo;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getLimitNum() {
        return limitNum;
    }

    public void setLimitNum(Integer limitNum) {
        this.limitNum = limitNum;
    }

    public Integer getSales() {
        return sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    /*public String getShareDes() {
        return shareDes;
    }

    public void setShareDes(String shareDes) {
        this.shareDes = shareDes;
    }*/

    public Integer getViews() {
        return views;
    }

    public void setViews(Integer views) {
        this.views = views;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getDataStatus() {
        return dataStatus;
    }

    public void setDataStatus(String dataStatus) {
        this.dataStatus = dataStatus;
    }

    public String getCompanyName() {
        if (company != null) {
            this.companyName = company.getCompanyName();
        }
        return companyName;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "goodsId=" + goodsId +
                ", companyId=" + companyId +
                ", goodsName='" + goodsName + '\'' +
                ", price=" + price +
                ", type=" + type +
                ", detailInfo='" + detailInfo + '\'' +
                ", endTime=" + endTime +
                ", limitNum=" + limitNum +
                ", sales=" + sales +
                /*", shareDes=" + shareDes +*/
                ", views=" + views +
                ", remarks='" + remarks + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", dataStatus='" + dataStatus + '\'' +
                '}';
    }
}
